function [residual, g1, g2] = a15_markups_cbase_static(y, x, params)
%
% Status : Computes static model for Dynare
%
% Inputs : 
%   y         [M_.endo_nbr by 1] double    vector of endogenous variables in declaration order
%   x         [M_.exo_nbr by 1] double     vector of exogenous variables in declaration order
%   params    [M_.param_nbr by 1] double   vector of parameter values in declaration order
%
% Outputs:
%   residual  [M_.endo_nbr by 1] double    vector of residuals of the static model equations 
%                                          in order of declaration of the equations
%   g1        [M_.endo_nbr by M_.endo_nbr] double    Jacobian matrix of the static model equations;
%                                                     columns: variables in declaration order
%                                                     rows: equations in order of declaration
%   g2        [M_.endo_nbr by (M_.endo_nbr)^2] double   Hessian matrix of the static model equations;
%                                                       columns: variables in declaration order
%                                                       rows: equations in order of declaration
%
%
% Warning : this file is generated automatically by Dynare
%           from model file (.mod)

residual = zeros( 18, 1);

%
% Model equations
%

T137 = (exp(y(2))-exp(y(2))*params(17))*getPowerDeriv(exp(y(2))-exp(y(2))*params(17),(-params(8)),1);
residual(1) = y(12);
residual(2) = y(13);
residual(3) = y(15);
lhs =y(11);
rhs =log(params(1))+y(6)-y(6);
residual(4)= lhs-rhs;
lhs =exp(y(6));
rhs =(exp(y(2))-exp(y(2))*params(17))^(-params(8))-(exp(y(2))-exp(y(2))*params(17))^(-params(8))*params(1)*params(17);
residual(5)= lhs-rhs;
lhs =params(9)*exp(y(5))^params(2);
rhs =exp(y(6))*exp(y(9));
residual(6)= lhs-rhs;
lhs =exp(y(6));
rhs =exp(y(7))*(1-y(12)-y(13))+y(13)*params(1)*exp(y(7));
residual(7)= lhs-rhs;
lhs =exp(y(7));
rhs =params(1)*(exp(y(6))*exp(y(8))+exp(y(7))*(1-params(3)));
residual(8)= lhs-rhs;
lhs =(1-y(12))*exp(y(4));
rhs =exp(y(3))-(1-params(3))*exp(y(3));
residual(9)= lhs-rhs;
lhs =y(1);
rhs =y(16)+y(3)*params(4)+y(5)*(1-params(4));
residual(10)= lhs-rhs;
lhs =y(8);
rhs =y(1)+(-y(10))+log(params(4))-y(3);
residual(11)= lhs-rhs;
lhs =y(9);
rhs =y(1)+(-y(10))+log(1-params(4))-y(5);
residual(12)= lhs-rhs;
lhs =(1+params(13))*(exp((-y(10)))-1/params(12))-params(13)*(1-1/params(12));
rhs =params(5)*exp(y(11))*exp((-y(10))-1/params(12));
residual(13)= lhs-rhs;
lhs =exp(y(2))+exp(y(4))+exp(y(14));
rhs =exp(y(1));
residual(14)= lhs-rhs;
lhs =y(14);
rhs =params(6)+y(17);
residual(15)= lhs-rhs;
lhs =y(16);
rhs =y(16)*params(18)+x(1);
residual(16)= lhs-rhs;
lhs =y(17);
rhs =x(2)+y(17)*params(19)+params(20)*y(18);
residual(17)= lhs-rhs;
lhs =y(18);
rhs =y(17);
residual(18)= lhs-rhs;
if ~isreal(residual)
  residual = real(residual)+imag(residual).^2;
end
if nargout >= 2,
  g1 = zeros(18, 18);

  %
  % Jacobian matrix
  %

  g1(1,12)=1;
  g1(2,13)=1;
  g1(3,15)=1;
  g1(4,11)=1;
  g1(5,2)=(-(T137-params(1)*params(17)*T137));
  g1(5,6)=exp(y(6));
  g1(6,5)=params(9)*exp(y(5))*getPowerDeriv(exp(y(5)),params(2),1);
  g1(6,6)=(-(exp(y(6))*exp(y(9))));
  g1(6,9)=(-(exp(y(6))*exp(y(9))));
  g1(7,6)=exp(y(6));
  g1(7,7)=(-(exp(y(7))*(1-y(12)-y(13))+y(13)*params(1)*exp(y(7))));
  g1(7,12)=exp(y(7));
  g1(7,13)=(-(params(1)*exp(y(7))+(-exp(y(7)))));
  g1(8,6)=(-(params(1)*exp(y(6))*exp(y(8))));
  g1(8,7)=exp(y(7))-params(1)*exp(y(7))*(1-params(3));
  g1(8,8)=(-(params(1)*exp(y(6))*exp(y(8))));
  g1(9,3)=(-(exp(y(3))-(1-params(3))*exp(y(3))));
  g1(9,4)=(1-y(12))*exp(y(4));
  g1(9,12)=(-exp(y(4)));
  g1(10,1)=1;
  g1(10,3)=(-params(4));
  g1(10,5)=(-(1-params(4)));
  g1(10,16)=(-1);
  g1(11,1)=(-1);
  g1(11,3)=1;
  g1(11,8)=1;
  g1(11,10)=1;
  g1(12,1)=(-1);
  g1(12,5)=1;
  g1(12,9)=1;
  g1(12,10)=1;
  g1(13,10)=(1+params(13))*(-exp((-y(10))))-params(5)*exp(y(11))*(-exp((-y(10))-1/params(12)));
  g1(13,11)=(-(params(5)*exp(y(11))*exp((-y(10))-1/params(12))));
  g1(14,1)=(-exp(y(1)));
  g1(14,2)=exp(y(2));
  g1(14,4)=exp(y(4));
  g1(14,14)=exp(y(14));
  g1(15,14)=1;
  g1(15,17)=(-1);
  g1(16,16)=1-params(18);
  g1(17,17)=1-params(19);
  g1(17,18)=(-params(20));
  g1(18,17)=(-1);
  g1(18,18)=1;
  if ~isreal(g1)
    g1 = real(g1)+2*imag(g1);
  end
end
if nargout >= 3,
  %
  % Hessian matrix
  %

  g2 = sparse([],[],[],18,324);
end
end
